declare var URL_PREFIX: string

function getFullUrl(url: string, urlPrefix: string): string {
  if (new RegExp(/^https?:\/\//).test(url)) {
    return url
  } else {
    return (urlPrefix || '') + url
  }
}

function getNotFoundPageUrl(): string {
  return getFullUrl('/404', URL_PREFIX)
}

function redirectToNotFoundPage(): boolean {
  window.location.replace(getNotFoundPageUrl())
  return true
}

export {getNotFoundPageUrl, redirectToNotFoundPage}
